/*
 * @Author: LuoRunfeng fleayun@gmail.com 
 * @Date: 2021-07-08 10:39:08 
 * @Last Modified by: LuoRunfeng fleayun@gmail.com
 * @Last Modified time: 2021-07-08 11:46:47
 */

import { asyncRoutes, constantRoutes } from '@/router'



const state = { routes: [] }
const getters = {
    routes: (state) => state.routes,
}
const mutations = {
    setRoutes(state, routes) {
        state.routes = routes
    },

}
const actions = {
    async setRoutes({ commit }) {
        const finallyRoutes = [...constantRoutes, ...asyncRoutes]
        commit('setRoutes', finallyRoutes)
        // console.log(finallyRoutes)
        return [...finallyRoutes]
    },
}
export default { state, getters, mutations, actions }
